<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/header_css::header('上级菜单-菜单管理')"></head>
<body>
	<div id="ltLTE" class="container-fluid" v-cloak>
		<ul id="menuTree" class="ztree"></ul>
	</div>
	<div th:include="include/footer_js::footer"></div>
	<script type="text/javascript">
		var setting = {
			data : {
				simpleData : {
					enable : true,
					idKey : "menu_id",
					pIdKey : "parent_id",
					rootPId : -1
				},
				key : {
					url : "nourl"
				}
			}
		};
		var ztree;

		var vm = new Vue({
			el : '#ltLTE',
			methods : {
				getMenu : function() {
					$.get('../../sys/menu/select', function(r) {
						ztree = $.fn.zTree
								.init($("#menuTree"), setting, r.rows);
						var node = ztree.getNodeByParam("menu_id",
								top.layerForm.vm.menu.parent_id);
						ztree.selectNode(node);
						top.layerForm.vm.menu.parentName = node.name;
					})
				},
				acceptClick : function() {
					var node = ztree.getSelectedNodes();
					top.layerForm.vm.menu.parent_id = node[0].menu_id;
					top.layerForm.vm.menu.parentName = node[0].name;
					dialogClose();
				}
			},
			created : function() {
				this.getMenu();
			}
		})
	</script>
</body>
</html>